<template>
	<view>
		<view class="grad">
			<view>
				<view class="rowsc " style="padding-top: 100rpx;">
					<view class="round rowsc align-center" style="background-color: #2AA5FE;width: 200rpx;height: 200rpx;">
						<view class="text-bold text-white" style="font-size: 50rpx;">
							<view class="text-center">
								<view class="">{{myscoreData.max_score}}</view>
								<view class="text-sm">
									历史最高分
								</view>
							</view>
						</view>
					</view>
				</view>
			</view>
			<view class="rowsa align-center padding">
				<view class="text-white text-center ">
					<view>{{myscoreData.pass}}</view>
					<view>合格次数</view>
				</view>
				<view class="text-white text-center ">
					<view>{{myscoreData.count}}</view>
					<view>累计次数</view>
				</view>
			</view>
		</view>
		<view class="padding">
			<view class="text-bold border-bottom padding-bottom-sm">
				历史成绩
			</view>
			<view class="rowsb padding-sm border-bottom" v-for="(item,index) in myscoreData.list">
				<view>
					{{item.score}}分
				</view>
				<view>
					{{item.add_time.substring(0,10)}}     
				</view>
				<view class="">
					{{item.time}}
				</view>
			</view>
		</view>
		<view v-if="myscoreData.list==''" class="text-center padding text-sm text-gray">
			暂无更多内容
		</view>
	</view>
</template>

<script>
	const app = getApp().globalData
	import {
		myscore,
	} from '../../../common/path.js'
	export default{
		data(){
			return{
				myscoreData:[],
				optionId:1
			}
		},
		onLoad(option) {
			if(option.id){
			this.optionId = option.id
			}
			this.myscore()
		},
		methods:{
			//我的成绩
			myscore() {
				let data = {
					uid: app.userInfo.id,
					type: this.optionId //1科目1 2 科目4
				}
				this.$axios.axios("POST", myscore, data)
					.then(res => {
						console.log('我的成绩===>', res)
						if(res.status==1){
						this.myscoreData = res.data
						}
					})
					.catch(err => {
						console.log(err)
					})
			},
		}
	}
</script>

<style>
	page {
		background-color: #FFFFFF;
	}

	.grad {
		background-image: linear-gradient(#4145F3, #4FAEF8);
	}
</style>
